import Vue from 'vue'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import App from './App.vue'
import VueRouter from "vue-router"
import main from './components/main.vue'
import home from './components/home.vue'
import gDL from './components/gDL.vue'
import gameDetail from './components/gameDetail.vue'
import square from './components/square.vue'
import more from './components/more.vue'
import gDetail1 from './components/gDetail1.vue'
import gDetail2 from './components/gDetail2.vue'

import news from './components/news.vue'
import newsD from './components/newsD.vue'


import signIn from './components/signIn.vue'
import register from './components/register.vue'

//开启debug模式
Vue.config.debug = true;
Vue.use(VueRouter);
Vue.use(MintUI)

import store from './vuex/store'
import axios from 'axios'
Vue.prototype.$http = axios;
// 创建一个路由器实例并且配置路由规则
const router = new VueRouter({
  mode: 'history',
  base: __dirname,
  routes: [
    {
      path:'/',
      component:main,
      children:[
        {path:'/',component:home},
        {path:'home',component:home},
        {path:'gDL',component:gDL},
        {path:'square',component:square},
        {path:'news',component:news}
      ]
    },
    {
      path:'/gameDetail',
      name:'gameDetail',
      component:gameDetail,
      children:[
        {path:'gDetail1',component:gDetail1},
        {path:'gDetail2',component:gDetail2}
      ]
    },

    {path:'/newsD',component:newsD},

    {path:'/more',component:more},


    {path:'/signIn',component:signIn},
    {path:'/register',component:register},

  ]
})

// 路由器会创建一个 App 实例，并且挂载到选择符 #app 匹配的元素上。
const app = new Vue({
      router: router,
      store,
      render: h => h(App)
}).$mount('#app')

